home *** CD-ROM | disk | FTP | other *** search
/ Hackers Magazine 57 / CdHackersMagazineNr57.iso / Software / Programming / RJTextEd.exe / {app} / InstallData / Scripts / examples / OpenTemplateFile.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2007-10-23  |  472 b   |  24 lines

  1. // A simple pascal script to open a template file.
  2. // You can assign a keyboard shortcut to the script.
  3.    
  4. function GetFilePath: WideString;
  5. begin
  6.    Result := MainApp.AppDataPath;
  7.    Result := Result + '\Templates\Html\New_UTF-8.htm';
  8. end;
  9.  
  10. procedure OpenFile(sz: WideString);
  11. begin
  12.    if not MainApp.OpenFile(sz) then
  13.       ShowMessage('Could not open the file!!!');
  14. end;
  15.  
  16. var
  17.    s: WideString;
  18.  
  19. begin
  20.    s := GetFilePath;
  21.    OpenFile(s); 
  22. end.
  23.  
  24.